package org.jeecg.cn.edu.scau.vm.job;

import org.jeecg.cn.edu.scau.vm.machineTime.service.IVmUserSettingsService;
import org.jetbrains.annotations.NotNull;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.quartz.QuartzJobBean;

import javax.annotation.Resource;
import java.time.LocalDateTime;

/**
 * 同步用户配置定时任务
 */
public class SyncUserSettingsJobs extends QuartzJobBean {
    private static final Logger logger = LoggerFactory.getLogger(SyncUserSettingsJobs.class);

    @Resource
    private IVmUserSettingsService vmUserSettingsService;

    @Override
    protected void executeInternal(@NotNull JobExecutionContext context) throws JobExecutionException {
        logger.info("{}开始执行用户配置同步任务", LocalDateTime.now());
        vmUserSettingsService.syncData();
        logger.info("{}结束执行用户配置同步任务", LocalDateTime.now());
    }
}
